<template>
    <div v-if="true">
        <div id="captcha"></div>
    </div>
</template>

<script setup>
    import '../vendor/SliderCaptcha/longbow.slidercaptcha.min.js';
    import { ref,onMounted } from 'vue';
    const emit=defineEmits(['verifyRes','verifyErr'])
    let captcha=ref(null)
    onMounted(()=>{
        captcha=sliderCaptcha({
            id:'captcha',//与上面结构的id对应
            onSuccess(){
                emit('verifyRes')
            },
            onFail(){
                emit('verifyErr')
            },
            verify(){
                // 默认认证行为
                return true
            }
        });
    })
</script>

<style lang="scss" scoped>
@import '../vendor/SliderCaptcha/slidercaptcha.min.css';
</style>